<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" dir="ltr" lang="en"
      th:with="assetBaseUrl=${@environment.getProperty('assetBaseUrl','/resources/oss')},
                isUaa=${T(org.cloudfoundry.identity.uaa.zone.IdentityZoneHolder).isUaa()},
                zoneName=${T(org.cloudfoundry.identity.uaa.zone.IdentityZoneHolder).get().getName()},
                branding=${T(org.cloudfoundry.identity.uaa.zone.IdentityZoneHolder).resolveBranding()},
                banner=${branding.getBanner()},
                companyName=${branding.getCompanyName() ?: 'Cloud Foundry'},
                copyrightCompanyName=${branding.getCompanyName() ?: 'CloudFoundry.org Foundation, Inc. '},
                copyrightFallback=${'Copyright &#169; ' + copyrightCompanyName + ' ' + #dates.year(#dates.createNow()) + '. All Rights Reserved.'},
                copyright=${branding.getFooterLegalText() ?: copyrightFallback}" >

<head>
    <title th:text="${isUaa ? companyName : zoneName}" th:inline="text"></title>
    <link href='/resources/oss/images/square-logo.png' th:with="icon=${branding.getSquareLogo()}" th:href="@{${icon != null ? 'data:image/png;base64,'+icon : (assetBaseUrl + '/images/square-logo.png')}}" rel='shortcut icon' />
    <meta charset='utf-8' />
    <meta name='author' th:content="|${companyName}|" />
    <meta name='copyright' th:content="|${copyright}|" />
    <meta name='robots' content='all' />
    <meta name='Description' content=""/>
    <meta name='keywords' content=""/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="stylesheet" media="screen" href="/resources/oss/stylesheets/pui-3.0.0/pivotal-ui.min.css" th:href="@{/resources/oss/stylesheets/pui-3.0.0/pivotal-ui.min.css}"/>
    <link rel="stylesheet" media="screen" href="/resources/oss/stylesheets/pui-3.0.0/flexbox.css" th:href="@{/resources/oss/stylesheets/pui-3.0.0/flexbox.css}"/>
    <link rel="stylesheet" media="screen" href="/resources/oss/stylesheets/mfa.css" th:href="@{/resources/oss/stylesheets/mfa.css}"/>
</head>

<body class="bg-neutral-10">
    <div th:if="${banner != null && (T(org.springframework.util.StringUtils).hasText(banner.getText()) || T(org.springframework.util.StringUtils).hasText(banner.getLogo()))}" class="banner-header"
            th:with="backgroundColor=${banner.getBackgroundColor() != null ? 'background-color :'+banner.getBackgroundColor()+';' : ''},
                    textColor=${banner.getTextColor() != null ? 'color :'+banner.getTextColor()+';' : ''}"
            th:style="${backgroundColor}+${textColor}">
        <a th:href="${banner.getLink() != null ? banner.getLink() : '#'}" href="#"
                th:with="linkColor=${banner.getTextColor() != null || banner.getLink() == null ? 'color:inherit;' : ''},
                linkCursor=${banner.getLink() == null ? 'cursor:default;' : ''}"
                th:style="${linkColor+linkCursor}">
            <img th:if="${banner.getLogo() != null}" th:src="'data:image/png;base64,'+${banner.getLogo()}" alt="bannerLogo" />
            <span th:if="${banner.getText() != null && banner.getLogo() == null}" th:text="${banner.getText()}"></span>
        </a>
    </div>
    <div class="page">
     <div class="mfa panel panel-basic bg-neutral-11 mvxl paxl">
        <div class="panel-body">
            <div class="txt-c paxl">
                <img class="img-responsive logo" th:with="logo=${branding.getProductLogo()},defaultLogo=@{${assetBaseUrl+'/images/product-logo.png'}}" th:src="${logo != null ? 'data:image/png;base64,'+logo : defaultLogo}" src="/resources/oss/images/product-logo.png"/>
                <h1 class="img-responsive" th:if="!${isUaa}" th:text="${zone_name}">Cloud Foundry</h1>
            </div>
            <div layout:fragment="page-content"></div>
        </div>
     </div>
    </div>

    <div class="txt-c type-neutral-5 type-sm footer-text mvl"
        th:with="links=${branding.getFooterLinks()}"
        th:inline="text"
        th:title="|Version: ${@buildInfo.version}, Commit: ${@buildInfo.commitId}, Timestamp: ${@buildInfo.timestamp}, UAA: ${@buildInfo.uaaUrl}|">
        [[${copyright}]]
        <th:block th:each="link,iter : ${links}"><th:block th:if="${!iter.first}"> &mdash;</th:block> <a href="/" th:href="${link.value}">[[${link.key}]]</a></th:block>
    </div>

</body>

</html>
